import {createSlice} from "@reduxjs/toolkit";

const userStore = createSlice({
    name: 'user',
    initialState: {
        user: null,
        isLogin : false
    },
    reducers: {
        setUser(state, action) {
            state.user = action.payload;
        },
        setIsLogin(state, action){
            state.isLogin = action.payload;
        }
    }
})

export const {setUser ,setIsLogin} = userStore.actions;
const reducer = userStore.reducer;
export default reducer;